Modern file systems can utilize a “copy-on-write” approach with respect to managing the creation and modification of files within a given file system volume. For example, the copy-on-write approach can enable an original file to be “cloned” (i.e., logically duplicated) and refer back to the same data of the original file so long as the original file and the cloned file remain unmodified. In turn, when either the original file or the cloned file is modified, the modified portion can be written into a new area of memory, and the modified file can be updated to refer (at least in part) to the new area of memory. In this manner, the overall storage space consumption rate by the file system volume can remain highly efficient, especially in scenarios where files are regularly cloned and marginally modified (e.g., edited photos/videos, modified databases, etc.).
Despite the various benefits that are afforded using the copy-on-write approach, file fragmentation—which is a side-effect of the copy-on-write approach, and substantially degrades performance—has yet to be addressed. In particular, and as mentioned above, the copy-on-write approach can involve establishing new portions of a file—often referred to as “extents”—each time the file is modified. Consequently, the file can become heavily fragmented as modifications are made to the file over time, where the different extents of the file are physically stored in a disjoined manner across the storage device. Notably, these disjoined extents can be problematic for a variety of storage devices, e.g., magnetic-based storage devices. In particular, it is both time and resource-intensive for these storage devices to relocate mechanical reading components to the disjoined extents when attempting to access the file. As a result, the overall latency associated with accessing the file—as well as the resources required to access the file—can scale with the fragmentation level of the file, thereby degrading both performance and the overall user experience.
Consequently, there exists a need for a more efficient approach for managing the fragmentation of files at a computing device.